10/5/2019

Goals:

  • 1. Create a web page presentation using R Markdown that features a plot created with Plotly
  • 2. Host the webpage on either GitHub Pages, RPubs, or NeoCities
  • 3. Your webpage must contain the date that you created the document, and it must contain a plot created with Plotly

Data set:

For this project we will use state.x77 data - a matrix with 50 rows and 8 columns giving the following statistics in the respective columns.

  • Population - population estimate as of July 1, 1975
  • Income - per capita income (1974)
  • Illiteracy - illiteracy (1970, percent of population)
  • Life Exp - life expectancy in years (1969–71)
  • Murder - murder and non-negligent manslaughter rate per 100,000 population (1976)
  • HS Grad - percent high-school graduates (1970)
  • Frost - mean number of days with minimum temperature below freezing (1931–1960) in capital or large city

Data processing

##    Population        Income       Illiteracy       Life Exp    
##  Min.   :  365   Min.   :3098   Min.   :0.500   Min.   :67.96  
##  1st Qu.: 1080   1st Qu.:3993   1st Qu.:0.625   1st Qu.:70.12  
##  Median : 2838   Median :4519   Median :0.950   Median :70.67  
##  Mean   : 4246   Mean   :4436   Mean   :1.170   Mean   :70.88  
##  3rd Qu.: 4968   3rd Qu.:4814   3rd Qu.:1.575   3rd Qu.:71.89  
##  Max.   :21198   Max.   :6315   Max.   :2.800   Max.   :73.60  
##      Murder          HS Grad          Frost             Area       
##  Min.   : 1.400   Min.   :37.80   Min.   :  0.00   Min.   :  1049  
##  1st Qu.: 4.350   1st Qu.:48.05   1st Qu.: 66.25   1st Qu.: 36985  
##  Median : 6.850   Median :53.25   Median :114.50   Median : 54277  
##  Mean   : 7.378   Mean   :53.11   Mean   :104.46   Mean   : 70736  
##  3rd Qu.:10.675   3rd Qu.:59.15   3rd Qu.:139.75   3rd Qu.: 81162  
##  Max.   :15.100   Max.   :67.30   Max.   :188.00   Max.   :566432

Correlation matrix with significance levels (p-value)

Correlation coefficients with significance test:

Illiteracy correlations:

Correlation of population Illiterracy with other variables
row column cor p
Illiteracy Murder 0.7029752 0.0000000
Illiteracy Frost -0.6719470 0.0000001
Illiteracy HS Grad -0.6571886 0.0000002
Illiteracy Life Exp -0.5884779 0.0000070
Illiteracy Area 0.0772611 0.5938266

Scatterplot Graph

It is clearly visible that the urder rate grow with population illiteracy.

Scatterplot with color

States with more cold days per year have higher % of HS Grads and lower Illiteracy ratio.

Choropleth Maps

Most South states have highest illiteracy ratio.